<template>
    <div class="CardToActive">
        <cardComponent pageTitle="申请处理类-->卡激活">
            <template slot="cardBody">
                <el-form :inline="true" label-position="right" size="small" label-width="150px">
                    <el-row>
                        <el-col :span="10" :offset="2">
                            <el-form-item label="账户类别:" class="text_fl">
                                <el-select
                                    v-model="formData.acctType"
                                    placeholder="请选择账户类别"
                                    clearable
                                    disabled
                                    @change="changeCardList"
                                >
                                    <el-option
                                        v-for="item in AccountionTYPE_INFO"
                                        :label="item.label"
                                        :value="item.code"
                                        :key="item.label"
                                    ></el-option>
                                </el-select>
                            </el-form-item>
                        </el-col>
                        <el-col :span="11">
                            <el-form-item label="卡号:" class="text_fl">
                                <el-select
                                    v-model="formData.cardNo"
                                    placeholder="请选择卡号"
                                    clearable
                                    disabled
                                    @change="changeCard"
                                >
                                    <el-option
                                        v-for="item in cardList"
                                        :label="item.CARDNBR"
                                        :value="item.CARDNBR"
                                        :key="item.CARDNBR"
                                    ></el-option>
                                </el-select>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="10" :offset="2">
                            <el-form-item label="卡产品:">
                                <el-input placeholder disabled v-model="formData.prodname"></el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="12">
                            <el-form-item label="卡介质:">
                                <el-input placeholder disabled v-model="formData.cardtype"></el-input>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="10" :offset="2">
                            <el-form-item label="身份证:">
                                <el-input placeholder disabled v-model="formData.custId"></el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="12">
                            <el-form-item label="年费代码:">
                                <el-input placeholder disabled v-model="formData.feeCode"></el-input>
                            </el-form-item>
                        </el-col>
                    </el-row>

                    <!-- 话术 -->
                    <div class="hstable_wrap" v-if="speechList.length!=0">
                        <el-table
                            :data="speechList"
                            border
                            stripe
                            header-row-class-name="headerRow"
                            ref="showListTable"
                            class="heard-bg business_table hstable"
                            @selection-change="handleSelectionChange"
                        >
                            <el-table-column type="selection" label=" " min-width="55"></el-table-column>
                            <el-table-column label="业务话术">
                                <template slot-scope="scope">{{scope.row.content}}</template>
                            </el-table-column>
                        </el-table>
                    </div>
                    <div align="center">
                        <el-col :span="24">
                            <el-button
                                v-show="sleepCardFlag"
                                type="primary"
                                @click="sleepCard"
                            >睡眠卡转未激活</el-button>
                            <el-button
                                type="primary"
                                size="small"
                                @click="cardToActivated"
                                :disabled="activeFlag"
                            >激活</el-button>
                        </el-col>
                    </div>
                </el-form>

                <!-- <div>
                    <el-form label-width="150px">                       
                    </el-form>
                </div>-->
                <div v-show="successFlag" align="center" style="margin-top:50px;">
                    <el-table
                        :data="tryData"
                        border
                        stripe
                        class="heard-bg business_table"
                        style="width: 80%;"
                        size="small"
                    >
                        <el-table-column label="激活成功">
                            <el-table-column prop="CUSTNAME" label="客户姓名"></el-table-column>

                            <el-table-column prop="CARDNO" label="激活卡号"></el-table-column>

                            <el-table-column prop="LIMIT" label="信用额度"></el-table-column>
                        </el-table-column>
                    </el-table>
                    <div align="center" style="margin-top:10px;">
                        <el-col :span="24">
                            <el-button plain size="small" type="primary" @click="szcxmm">查询密码设置</el-button>
                            <el-button plain size="small" type="primary" @click="czcxmm">查询密码重置</el-button>
                            <el-button plain size="small" type="primary" @click="szjymm">交易密码设置</el-button>
                            <el-button plain size="small" type="primary" @click="czjymm">交易密码重置</el-button>
                        </el-col>
                    </div>
                </div>

                <el-dialog
                    v-drag
                    title="睡眠卡转未激活"
                    :visible.sync="centerDialogVisibleonload"
                    width="500px"
                    :append-to-body="true"
                    top="30vh"
                    :close-on-click-modal="false"
                    center
                >
                    <p>
                        卡号：
                        <span>{{this.formData.cardNo}}</span>
                    </p>
                    <p class="text_center padding_top15">
                        <span style="color:#3a8ee6; ">确认转为未激活吗？</span>
                    </p>
                    <span slot="footer" class="dialog-footer">
                        <el-button
                            size="small"
                            icon="el-icon-circle-close"
                            @click="centerDialogVisibleonload=false"
                        >取 消</el-button>
                        <el-button
                            type="primary"
                            size="small"
                            @click="sleepCardChange"
                            icon="el-icon-circle-check"
                            v-preventReClick
                        >确定</el-button>
                    </span>
                </el-dialog>
            </template>
        </cardComponent>
    </div>
</template>

<script>
import { mapState } from 'vuex';
import {
    getDictValue,
    itoStr,
    closePage,
    updateDeal3004,
    updateDeal3601,
    updateCardAccount3001,
    getDictMappingValue,
    getDictSelectList,
    getBusinessMenuId
} from '@/utils/Common';
import cardComponent from '@/components/cardComponent/cardComponent.vue';
import moment from 'moment';

export default {
    name: 'CardToActive',
    components: {
        cardComponent,
    },
    data() {
        return {
            rules: {
                BEGDATE: [{ required: true, message: '请选择菜单类型' }],
            },
            formData: {
                acctType: '',
                cardNo: '',
                custId: '',
                feeCode: '',
                crdLimt: '',
                custName: '',
                prodname: '',
                cardtype: ''
            },
            productId: '', // 判断卡类别,
            cardStatus: '', // 卡状态
            sleepCardFlag: false,
            successFlag: false,
            centerDialogVisibleonload: false,//
            centerDialogVisible: false,
            errorMessage: '',//汽车卡、惠享金卡激活提示
            cardList: [],
            activeFlag: false,
            page_cardInfo_3004: {},
            feeamtList: [],
            tryData: [
                {
                    CUSTNAME: '',
                    CARDNO: '',
                    LIMIT: ''
                },
            ],
            speechList: [],//话术列表
            selectedList: [],
            MenuId: '',
        };
    },
    computed: mapState({
        cardInfo_3004: state => state.common.cardInfo_3004, // 默认卡信息
        cardList_3601: state => state.common.cardList_3601, // 卡列表数据
        defaultParams: state => state.common.defaultParams, // 接口默认参数
        pinFlag: state => state.common.pinFlag, // 是否密码检查标志
        cardAcct_3001: state => state.common.cardAccountInfo_3001, // 卡账户信息
        currentSessionObj: state => state.common.currentSessionObj, // 软电话随路数据
        customerInfo_3002: state => state.common.customerInfo_3002, // 客户信息
        AccountionTYPE_INFO: state => state.common.AccountionTYPE_INFO, //账户类别列表
        isCurrentMenuInfo: state => state.menu.isCurrentMenuInfo,
        businessMenu: state => state.menu.businessMenu,
        checAllData: state => state.common.checAllData,
    }),
    async mounted() {
        this.MenuId = this.$route.params.id || '';
        this.productList = await getDictSelectList('PRODUCT', this);
        this.feeamtList = await getDictSelectList('FEEAMT', this);
        this.getCardInfo();
        await this.getspeechList();

    },
    methods: {
        changeCardList(val) {

            console.log("当前账户类型：" + val);
            this.cardList = [];
            this.cardList_3601.forEach((item) => {
                if (item.CATEGORY + '' === val) {
                    this.cardList.push(item);
                }
            });
        },
        // 获取卡列表信息
        async getCardInfo(val) {
            /*
            this.cardList_3601.forEach((item) => {
                if (item.CARDNBR === this.page_cardInfo_3004.CARDNO) {
                    console.log(this.page_cardInfo_3004);
                    this.productId = itoStr(item.PRODUCT, 4);
                    this.formData.cardStatus = item.CARDSTAT.trim();
                }
            });*/

            //判断是否预留号码来电，不是预留号码无法办理激活
            let homephone6 = this.customerInfo_3002.HOMEPHONE.trim();
            let mbphone11 = this.customerInfo_3002.MOBILEPHONE.trim();
            if (homephone6 != '') {
                homephone6 = homephone6.substring(homephone6.length - 6, homephone6.length);
            }
            if (mbphone11 != '') {
                mbphone11 = mbphone11.substring(mbphone11.length - 11, mbphone11.length);
            }
            if (!(this.currentSessionObj.ani === '' || this.currentSessionObj.ani === undefined)) {
                let anis = this.currentSessionObj.ani.trim();
                if (anis.substring(anis.length - 6, anis.length) != homephone6 && anis.substring(anis.length - 11, anis.length) != mbphone11) {
                    this.$alert(
                        '非预留号码来电，无法办理激活！',
                        '提示',
                        { customClass: 'warning', type: 'warning', showClose: false },
                    ).then(() => {
                        // 不允许激活
                        this.activeFlag = true;
                    });
                } else {
                    this.activeFlag = false;
                }
            }

            if (val == '1') {
                // 切换默认卡
            } else {
                // 页面初始化取默认卡
                this.page_cardInfo_3004 = this.cardInfo_3004;
            }
            console.log('当前卡');
            console.log(this.page_cardInfo_3004);
            this.productId = itoStr(this.page_cardInfo_3004.PRODUCT, 4);
            this.cardStatus = this.page_cardInfo_3004.CARDSTAT.trim();
            this.formData.cardNo = this.page_cardInfo_3004.CARDNO.trim();
            this.formData.custId = this.page_cardInfo_3004.CUSTID.trim();
            this.formData.crdLimt = this.page_cardInfo_3004.CRDLIMT;
            this.formData.custName = this.page_cardInfo_3004.NAME.trim();
            this.formData.acctType = this.page_cardInfo_3004.CATEGORY ? (this.page_cardInfo_3004.CATEGORY + '').trim() : '';
            this.formData.feeCode = await getDictMappingValue('FEECODE', this.page_cardInfo_3004.FEECODE, this);

            //卡产品名称翻译
            this.productList.forEach((item) => {
                if (item.code === this.productId) {
                    console.log(item.label + ":" + this.productId);
                    this.formData.prodname = item.label.trim();
                }
            });
            //卡介质，实体卡，虚拟卡，虚实同发
            console.log("VCNSTS:", this.page_cardInfo_3004.VCNSTS.trim());
            if (this.page_cardInfo_3004.VCNSTS.trim() === 'A') {
                this.formData.cardtype = '虚拟卡';
            } else if (this.page_cardInfo_3004.VCNSTS.trim() === 'B') {
                this.formData.cardtype = '虚实同发卡';
            } else {
                this.formData.cardtype = '实体卡';
            }

            // 非睡眠卡，隐藏该按钮
            if (this.cardStatus == 'U' || this.cardStatus == 'W') {
                this.sleepCardFlag = true;
            } else {
                this.sleepCardFlag = false;
            }
            this.changeCardList(this.formData.acctType);


            // 白山客户提示
            if (this.productId === '0060') {

                this.$alert(
                    '白山客户，请注意配发卡片禁止激活！',
                    '提示',
                    { customClass: 'warning', type: 'warning', showClose: false },
                ).then(() => {

                });

            }
            // this.cardStatus = 'U';
            // 网申卡提示面签
            if (this.page_cardInfo_3004.ISSMOD === '01') {

                this.$alert(
                    '该卡为网申卡，请提醒客户完成网点面签！',
                    '提示',
                    { customClass: 'warning', type: 'warning', showClose: false },
                ).then(() => {

                });

            }
        },
        //根据菜单id查询话术列表
        async getspeechList() {
            console.log("this.isCurrentMenuInfo.id", this.isCurrentMenuInfo.id);
            var checkParam = {
                'id': this.MenuId || this.isCurrentMenuInfo.id,
            };
            this.$post.busiMenu.getlistByMenuId(checkParam).then((res) => {
                console.log("话术查询结果：", res);
                if (res.status === 200) { // http通讯成功
                    if (res.data.status == 0) { // 业务请求成功
                        this.speechList = res.data.content;
                    }
                }
            });
        },
        handleSelectionChange(val) {
            this.selectedList = val;
        },

        async changeCard(val) {

            await this.queryCardInfo_3004();

            this.activeFlag = false;

            let msg = this.checkCard();
            if (msg) {
                this.$alert(
                    msg,
                    '提示',
                    { customClass: 'warning', type: 'warning', showClose: false },
                ).then(() => {
                    // 不允许激活
                    this.activeFlag = true;
                });
            }
        },


        async queryCardInfo_3004() {
            const defaultParamInfo = JSON.parse(JSON.stringify(this.defaultParams));
            defaultParamInfo.body.appHead.tranCode = '3004';// 修改交易号
            defaultParamInfo.body.appBody = {
                CARDNO: this.formData.cardNo,
                CARDNBR: this.formData.cardNo,
                PINFLAG: '',
            };
            await this.$post.common.transPort(defaultParamInfo).then((res) => {
                const result = JSON.parse(res.data.jsonRes);
                if (res.status === 200) {
                    if (result.sysHead.rspCd == '000000') {
                        this.page_cardInfo_3004 = result.body.appBody;

                        // 切换卡号
                        this.getCardInfo(1);
                    } else {
                        const errorMsg = `错误代码：${result.sysHead.rspCd}, 错误信息：${result.sysHead.rspMsg}`;
                        this.$alert(errorMsg, '提示', {
                            customClass: 'error', type: 'error',
                        });
                    }
                } else {
                    this.$alert('请求失败！', '提示', {
                        customClass: 'error', type: 'error',
                    });
                }
            });
        },


        checkCard() {
            // console.log('checkCard');
            console.log('卡片状态' + this.cardStatus);
            console.log('发卡模式：' + this.page_cardInfo_3004.ISSMOD);
            console.log('是否面签：' + this.page_cardInfo_3004.SIGNFLAG);
            console.log('卡种：' + this.productId);
            console.log('大额分期额度有效期：' + this.cardAcct_3001.MPLEXP);
            console.log('是否面签：' + this.page_cardInfo_3004.SIGNFLAG);

            // 校验来电号码是否为预留手机或预留家庭号码
            // 取来电号码

            let msg = '';

            let anis = this.currentSessionObj.custData ? this.currentSessionObj.custData.ANIS : '';
            // this.page_cardInfo_3004.ISSMOD = '01';
            // this.page_cardInfo_3004.SIGNFLAG = '1'
            // this.cardStatus = 'U';
            // console.log(this.cardStatus);
            // this.productId = '0067';
            // this.cardAcct_3001.MPLEXP = '20210621';

            let reservedMobile = this.customerInfo_3002.MOBILEPHONE ? this.customerInfo_3002.MOBILEPHONE.trim() : '';
            let reservedTel = this.customerInfo_3002.HOMEPHONE ? this.customerInfo_3002.HOMEPHONE.trim() : '';

            // console.log('来电号码' + anis);
            // console.log('预留手机：' + reservedMobile);
            // console.log('预留电话：' + reservedTel);

            //同软电话联调时，打开此逻辑判断
            // if (anis && (anis == reservedMobile || anis == reservedTel)) {
            //     // 来电号码为预留手机或预留电话
            // } else {
            //     msg = '来电号码非预留手机或预留电话，不能激活';
            //     return msg;
            // }

            // 是否睡眠卡,如果是睡眠卡U或W，调用接口，使状态变更为未激活状态A
            if (this.cardStatus == 'U' || this.cardStatus == 'W') {
                this.sleepCardFlag = true;
            }


            // 校验卡状态 逾期O，止付B，冻结D，挂失L，销卡T，销户，持卡人请求关闭Q
            if (this.cardStatus == 'O') {
                msg = '卡片逾期，不能激活';
            } else if (this.cardStatus == 'B') {
                msg = '卡片止付，不能激活';
            } else if (this.cardStatus == 'D') {
                msg = '卡片冻结，不能激活';
            } else if (this.cardStatus == 'L') {
                msg = '卡片挂失，不能激活';
            } else if (this.cardStatus == 'T') {
                msg = '卡片已销卡，不能激活';
            } else if (this.cardStatus == 'Q') {
                msg = '持卡人请求关闭，不能激活';
            }
            if (msg) return msg;

            // 如果是网申卡，未面签不能激活（消费分期除外 0094）  01为网申卡
            // if (this.page_cardInfo_3004.ISSMOD == '01') {

            //     // 消费分期除外
            //     if (this.productId && this.productId != '0094') {
            //         // 网申卡未面签，不能激活
            //         if (this.page_cardInfo_3004.SIGNFLAG == '1') {
            //             msg = "网申卡未面签，不能激活";
            //             return msg;
            //         }
            //     }

            // }

            // 校验卡产品
            // 卡种为徽农卡，南京惠享金卡，校验3001 182域(大额分期额度有效期 MPLEXP) cardAcct_3001 
            if (this.productId == '0067' || this.productId == '0066') {
                // 有效期
                let yxq = this.cardAcct_3001.MPLEXP;

                // 距离客户来电（当前时间）小于90天，与客户确认是否办理激活
                let currentDate = moment(new Date()).format('YYYYMMDD');
                let after90Date = moment(new Date()).add(90, 'days').format('YYYYMMDD');

                if (currentDate > yxq) {
                    //console.log("啥都不说了");
                } else if (after90Date > yxq) {
                    //console.log("三个月内了");
                    let msgTip = '卡片有效期已不足3个月，请与客户确认是否继续激活该卡片';
                    this.$alert(
                        msgTip,
                        '提示',
                        {
                            customClass: 'success', type: 'success',
                        },
                    );
                }

            }

            return msg;
        },

        activeCheckCard() {
            console.log(this.cardStatus);
            let msg = '';

            if (this.cardStatus == 'U' || this.cardStatus == 'W') {
                msg = '睡眠卡请先转未激活状态';
            }
            return msg;
        },


        // 非联名卡进行卡激活
        cardToActivated() {
            console.log("this.selectedList.length", this.selectedList.length);
            if (this.selectedList.length != this.speechList.length) {
                this.$alert('话术尚未全部勾选！', '提示', {
                    customClass: 'warning', type: 'warning',
                });
                return;
            }
            let msg = this.activeCheckCard();
            if (msg) {
                this.$alert(
                    msg,
                    '提示',
                    { customClass: 'warning', type: 'warning', showClose: false },
                );
            } else {
                let msg = this.checkCard();
                if (msg) {
                    this.$alert(
                        msg,
                        '提示',
                        { customClass: 'warning', type: 'warning', showClose: false },
                    )
                } else {
                    // 参数转换
                    const newCardNo = this.formData.cardNo.trim();
                    const IDNO6 = newCardNo.substring(newCardNo.length - 6);
                    let confirmMsg = "激活一经办理成功无法撤销，请确认是否办理激活";
                    console.log(this.productId);
                    if (this.productId === '0041' || this.productId === '0066') {
                        let feeamt = '';
                        this.feeamtList.forEach((item) => {
                            if (parseInt(item.label) === parseInt(this.productId)) {
                                console.log('年费', item.code);
                                feeamt = item.code.trim();
                            }
                        });
                        confirmMsg = '信用卡卡号' + this.formData.cardNo + ',正在操作' + this.formData.prodname + '激活,一旦激活将立即收取' + feeamt + '元年费,是否确认办理？';
                    }
                    const appBody = {
                        CARDNBR: this.formData.cardNo || '', // 卡号
                        OPTION: '000000000000000', // 检查项目选择  全部不检查
                        IDNO6, // 证件号码的后6位,不包括18位身份证号码最后的校验位，根据检查项目选择域中上送检查证件号码后6位时，必填
                        HOMETEL: '', // 家庭电话 系统将过滤以下符号(、-、)；根据检查项目选择域中上送检查家庭电话时，必填
                        BIRTHDAY: '', // YYYYMMDD根据检查项目选择域中上送检查出生日期时，必填
                        MBPHONE: '', // 根据检查项目选择域中上送检查手机号码时，必填
                        RESERVE: '', // 0-9，和a-z根据检查项目选择域中上送检查客户预留答案时，必填
                        TELNO: '', // 可选，渠道为TB、AG等可以上送客户来电号码，用于记录日志
                        CVV2: '', // 根据检查项目选择域中上送检查卡片CVV2时，必填
                        EXPIRYDTE: '', // MMYY根据检查项目选择域中上送检查卡片有效期时，必填
                        KEYTYPE: '', // 以银行在CODES/ETHNC中参数定义为准根据检查项目选择域中上送检查证件类型时，必填
                        CUSTID: '', // 根据检查项目选择域中上送检查证件号码时，必填
                        UCKACFYN: '1', // 1-不检查 其他-检查
                        PINFLAG: this.pinFlag,
                        PIN: '',
                    };
                    const defaultParams = JSON.parse(JSON.stringify(this.defaultParams));
                    defaultParams.body.appHead.tranCode = '4070';
                    defaultParams.body.appBody = appBody;
                    // 4070交易
                    this.$confirm(confirmMsg).then(() => {
                        this.$post.common.transPort(defaultParams).then((res) => {
                            if (res.status === 200) {
                                const result = JSON.parse(res.data.jsonRes);
                                if (result.sysHead.rspCd === '000000') {
                                    this.$alert(
                                        result.sysHead.rspMsg,
                                        '提示',
                                        {
                                            customClass: 'success', type: 'success',
                                        },
                                    );
                                    this.successFlag = true;
                                    // 更新卡状态
                                    updateDeal3004(this.formData.cardNo, this);
                                    updateDeal3601(this.formData.cardNo, this.cardInfo_3004.KEYTYPE, this.formData.custId, this);
                                    updateCardAccount3001(this.formData.cardNo, this);
                                    this.tryData = [{
                                        CUSTNAME: this.formData.custName,
                                        CARDNO: this.formData.cardNo,
                                        LIMIT: this.formData.crdLimt

                                    }];
                                    this.updateCheckData('A', '');
                                } else {
                                    const errorMsg = `错误代码：${result.sysHead.rspCd}, 错误信息：${result.sysHead.rspMsg}`;
                                    this.$alert(errorMsg, '提示', {
                                        customClass: 'error', type: 'error',
                                    });
                                }
                            } else {
                                this.$alert('请求失败！', '提示', {
                                    customClass: 'error', type: 'error',
                                });
                            }
                        });
                    });
                }
            }
        },

        updateCheckData(precardstat, nowcardstat) {
            const checAllDataItem = JSON.parse(JSON.stringify(this.checAllData));
            precardstat = precardstat.trim() === '' ? '空' : precardstat.trim();
            nowcardstat = nowcardstat.trim() === '' ? '空' : nowcardstat.trim();
            checAllDataItem[precardstat].falg = false;
            checAllDataItem[nowcardstat].falg = true;
            // 修改验证开关 结束后再 保存一下 checAllDataItem
            this.$store.commit('common/SAVE_CHECK_DATA', checAllDataItem);
        },

        // 睡眠卡
        sleepCard() {
            this.centerDialogVisibleonload = true;
        },
        sleepCardChange() {
            this.centerDialogVisibleonload = false;
            const appBody = {
                CARDNBR: this.formData.cardNo || '', // 卡号
                CANCODE: 'A',
                LOSTTYPE: 'PHN',
                OPTION: '000000000000000',
                PINFLAG: this.pinFlag,
                PIN: '',
            };
            const defaultParams = JSON.parse(JSON.stringify(this.defaultParams));
            defaultParams.body.appHead.tranCode = '4018';
            defaultParams.body.appBody = appBody;
            // 4037交易
            this.$post.common.transPort(defaultParams).then((res) => {
                if (res.status === 200) {
                    const result = JSON.parse(res.data.jsonRes);
                    // console.log(result, 2222)
                    if (result.sysHead.rspCd === '000000') {
                        this.$alert(
                            result.sysHead.rspMsg,
                            '提示',
                            {
                                customClass: 'success', type: 'success',
                            },

                        );
                        updateDeal3004(this.formData.cardNo, this);
                        updateDeal3601(this.formData.cardNo, this.cardInfo_3004.KEYTYPE, this.formData.custId, this);
                        this.queryCardInfo_3004();
                        this.updateCheckData('U', 'A');
                    } else {
                        const errorMsg = `错误代码：${result.sysHead.rspCd}, 错误信息：${result.sysHead.rspMsg}`;
                        this.$alert(errorMsg, '提示', {
                            customClass: 'error', type: 'error',
                        });
                    }
                } else {
                    this.$alert('请求失败！', '提示', {
                        customClass: 'error', type: 'error',
                    });
                }
            });
        },

        //查询密码设置
        szcxmm() {
            const cardNo = this.formData.cardNo;
            console.log("cardNo", cardNo);

            //this.$router.push({ name: 'pwdApply', path: '/index/pwdApply', params: { cardNo } });

            this.MenuId = getBusinessMenuId('/index/pwdApply', this.businessMenu);
            console.log('this.MenuId____', this.MenuId);
            this.$router.push({ name: 'pwdApply', path: '/index/pwdApply', params: { cardNo: cardNo, id: this.MenuId } });

        },
        //查询密码重置
        czcxmm() {
            const cardNo = this.formData.cardNo;
            console.log("cardNo", cardNo);
            this.MenuId = getBusinessMenuId('/index/pwdReset', this.businessMenu);
            console.log('this.MenuId____', this.MenuId);
            this.$router.push({ name: 'pwdReset', path: '/index/pwdReset', params: { cardNo: cardNo, id: this.MenuId } });
        },
        //交易密码设置
        szjymm() {
            const cardNo = this.formData.cardNo;
            console.log("cardNo", cardNo);
            this.MenuId = getBusinessMenuId('/index/paypwdApply', this.businessMenu);
            console.log('this.MenuId____', this.MenuId);
            this.$router.push({ name: 'paypwdApply', path: '/index/paypwdApply', params: { cardNo: cardNo, id: this.MenuId } });
        },
        //交易密码重置
        czjymm() {
            const cardNo = this.formData.cardNo;
            console.log("cardNo", cardNo);
            this.MenuId = getBusinessMenuId('/index/paypwdReset', this.businessMenu);
            console.log('this.MenuId____', this.MenuId);
            this.$router.push({ name: 'paypwdReset', path: '/index/paypwdReset', params: { cardNo: cardNo, id: this.MenuId } });
        },
        // 睡眠卡
        sleepCard_4037() {
            const appBody = {
                CARDNBR: this.formData.cardNo || '', // 卡号
            };
            const defaultParams = JSON.parse(JSON.stringify(this.defaultParams));
            defaultParams.body.appHead.tranCode = '4037';
            defaultParams.body.appBody = appBody;
            // 4037交易
            this.$post.common.transPort(defaultParams).then((res) => {
                if (res.status === 200) {
                    const result = JSON.parse(res.data.jsonRes);
                    // console.log(result, 2222)
                    if (result.sysHead.rspCd === '000000') {
                        this.$alert(
                            result.sysHead.rspMsg,
                            '提示',
                            {
                                customClass: 'success', type: 'success',
                            },
                        );
                    } else {
                        const errorMsg = `错误代码：${result.sysHead.rspCd}, 错误信息：${result.sysHead.rspMsg}`;
                        this.$alert(errorMsg, '提示', {
                            customClass: 'error', type: 'error',
                        });
                    }
                } else {
                    this.$alert('请求失败！', '提示', {
                        customClass: 'error', type: 'error',
                    });
                }
            });
        },
    },
};
</script>

<style lang='scss'>
.CardToActive {
    .text_center {
        text-align: center;
        padding-bottom: 25px;
    }
    .title_left {
        padding-left: 20px;
    }
}
</style>
